package cn.jinshengda.controller;


import cn.jinshengda.Dto.UsernameAndPassword;
import cn.jinshengda.entity.Admin;
import cn.jinshengda.service.AdminService;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2022-01-08
 */
@RestController
@CrossOrigin
public class AdminController {

    @Autowired
    private AdminService adminService;

    @PostMapping("/admin/login")
    public ResponseEntity<Map<String,Object>> login(@RequestBody UsernameAndPassword uap){
        System.out.println(uap);
        return new ResponseEntity<>(adminService.login(uap),HttpStatus.OK);
    }

}

